#######计算器测试用例
'''
    python:
    unittest:
        1.大量用例的重复开发问题
        2.unittest生成一份界面版测试报告
    1.导入unittest 的testCase
    1.1 子类继承TestCase :  有资格执行单元测试
    1.2 书写测试用例：必须test开头

    断言：
        self.assertXxxx()断言方式
'''

from  jisuanqi import Calc
from unittest import TestCase
#加法
class TestCalc(TestCase):
    def testadd1(self):
        #1.
        a = 6
        b = 5
        c = 11
        #2.
        calc = Calc()
        s = calc.add(a,b)
        #3.
        self.assertEqual(c,s)

    def testadd2(self):
        # 1.
        a = -6
        b = -5
        c = -11

        # 2.
        calc = Calc()
        s = calc.add(a,b)

        # 3.
        self.assertEqual(c,s)

    def testadd3(self):
        # 1.
        a = 10000000000000000000000000000000000000000000000000
        b = 5
        c = 10000000000000000000000000000000000000000000000005

        # 2.
        calc = Calc()
        s = calc.add(a,b)

        # 3.
        self.assertEqual(c,s)
#减法

    def testminus1(self):
        a = 6
        b = 5
        c = 1

        calc = Calc()
        s = calc.minus(a,b)

        self.assertEqual(c,s)


    def testminus2(self):
        a = 6
        b = -5
        c = 11

        calc = Calc()
        s = calc.minus(a,b)

        self.assertEqual(c,s)

    def testminus3(self):
        a = -6
        b = -5
        c = -1

        calc = Calc()
        s = calc.minus(a,b)

        self.assertEqual(c,s)
#乘法
    def testmulti1(self):
        # 1.
        a = 6
        b = 5
        c = 30
        # 2.
        calc = Calc()
        s = calc.multi(a, b)
        # 3.
        self.assertEqual(c, s)

    def testmulti2(self):
        # 1.
        a = 6
        b = -5
        c = -30
        # 2.
        calc = Calc()
        s = calc.multi(a, b)
        # 3.
        self.assertEqual(c, s)

    def testmulti3(self):
        # 1.
        a = 1.1
        b = 1.2
        c = 1.32
        # 2.
        calc = Calc()
        s = calc.multi(a, b)
        # 3.
        self.assertEqual(c, s)

#除法

    def testdevision1(self):
        # 1.
        a = 6
        b = 5
        c = 1.2
        # 2.
        calc = Calc()
        s = calc.devision(a, b)
        # 3.
        self.assertEqual(c, s)

    def testdevision2(self):
        # 1.
        a = 6
        b = 3
        c = 2
        # 2.
        calc = Calc()
        s = calc.devision(a, b)
        # 3.
        self.assertEqual(c, s)

    def testDevision3(self):
        # 1.
        a = 6
        b = -2
        c = -3
        # 2.
        calc = Calc()
        s = calc.devision(a, b)
        # 3.
        self.assertEqual(c, s)